Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#21786 Fixed asynchronous email sending for the sales entities which were created with disabled email sending #21788

Conversation

serhiyzhovnir
Copy link

Description (*)

Fixed asynchronous email sending for the sales entities which were created with disabled email sending

Fixed Issues (if relevant)

  1. Asynchronous email sending for the sales entities which were created with disabled email sending #21786: Asynchronous email sending for the sales entities which were created with disabled email sending

Preconditions (*)

  1. Magento 2.3.*
  2. Magento 2.2.*
  3. CRON should be enabled
  4. the sales_email/general/async_sending config should be enabled (Stores->Configuration->Sales->Sales Emails->General Settings->Asynchronous sending)

Manual testing scenarios (*)

  1. Disable email sending config for Invoice, Creditmemo, Shipment entities (Stores->Configuration->Sales->Sales Emails)
  2. Create Invoice, Creditmemo, Shipment via admin panel
  3. Enable email sending config for Invoice, Creditmemo, Shipment entities
  4. Wait for CRON or trigger it manually via bin/magento cron:run command

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@ghost
Copy link

ghost commented Mar 16, 2019

@serhiyzhovnir unfortunately, only members of the maintainers team are allowed to assign developers to the pull request

@ghost ghost unassigned dmytro-ch Mar 16, 2019
@magento-engcom-team
Copy link
Contributor

Hi @serhiyzhovnir. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-engcom-team magento-engcom-team added Release Line: 2.3 Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner and removed Component: AsynchronousOperations Component: Email labels Mar 16, 2019
@dmytro-ch dmytro-ch self-requested a review March 16, 2019 12:47
@dmytro-ch dmytro-ch self-assigned this Mar 16, 2019
@magento-engcom-team
Copy link
Contributor

Hi @dmytro-ch, thank you for the review.
ENGCOM-4512 has been created to process this Pull Request

@soleksii
Copy link

Hi @serhiyzhovnir ! I cannot reproduce the issue on 2.3-develop instance.

Preconditions:

  1. Clean Magento 2.3;
  2. CRON is enable;
  3. "Asynchronous sending" is enable ( Stores->Configuration->Sales->Sales Emails->General Settings ->Asynchronous sending)

Steps to reproduce:

  1. Disable email sending config for Invoice, Creditmemo, Shipment entities (Stores->Configuration->Sales->Sales Emails);
  2. Create Invoice, Creditmemo, Shipment via admin panel;
  3. Enable email sending config for Invoice, Creditmemo, Shipment entities;
  4. Wait for CRON or trigger it manually via bin/magento cron:run command

Actual Result:
The emails for the sales entities which were created with disabled email sending do not send via asynchronous email sending after enabling the email sending config for the sales entities.

Please, check again on the latest 2.3 instance.

@serhiyzhovnir
Copy link
Author

Hi @stoleksiy
I’ve missed mention the notifications actions for order entities.

The main purpose of this pull request is to remove hardcoded values for send email field for sales entities.
After the changes of this PR the order email send value will be configured according to
On Magento 2 the issue with the order asynchronous email sending in scope of #18698 issue.

I've prepared new steps to reproduce.
We also need to trigger notify actions for Shipment, Invoice and Creditmemo entities.
These actions might be triggered by API.
In the real life these actions might be triggered by some third party integrations, for example some integration can trigger notify action when an invoice transaction is approved.

Steps To Reproduce

  1. Disable email sending config for Invoice, Creditmemo, Shipment entities (Stores->Configuration->Sales->Sales Emails);
  2. Create Invoice, Creditmemo, Shipment via admin panel;
  3. Trigger notify actions for Shipment, Invoice and Creditmemo entities (See the instruction bellow);
  4. Enable email sending config for Invoice, Creditmemo, Shipment entities;
  5. Wait for CRON or trigger it manually via bin/magento cron:run command

Trigger Notify Actions

Install Postman

Install the Postman https://www.getpostman.com/.

Create Magento integration

  • Create Magento Integration

Screen Shot 2019-04-01 at 17 37 11

Screen Shot 2019-04-01 at 17 37 21

* Activate integration

Screen Shot 2019-04-01 at 17 37 39

  • All postman requests should contain the header authorization with Access Token from Magento Integration like Bearer {Magento Access Token}

Screen Shot 2019-04-01 at 17 44 30

Screen Shot 2019-04-01 at 17 53 46

Trigger Notify Actions for Invoice

The postman request should look like on the following screenshot:
Screen Shot 2019-04-01 at 18 20 56

Request URL: {Magento URL}/rest/all/V1/invoices/{Invoice ID}/emails
Make sure that you use POST request and that a invoice id is right.

Trigger Notify Actions for Shipment

The postman request should look like on the following screenshot:
Screen Shot 2019-04-01 at 18 20 40
Request URL: {Magento URL}/rest/all/V1/shipment/{Shipment ID}/emails
Make sure that you use POST request and that a shipment id is right.

Trigger Notify Actions for Creditmemo

The postman request should look like on the following screenshot:
Screen Shot 2019-04-01 at 18 25 44
Request URL: {Magento URL}/rest/all/V1/creditmemo/{Creditmemo ID}/emails
Make sure that you use POST request and that a creditmemo id is right.

Thank you!

@soleksii
Copy link

soleksii commented Apr 2, 2019

Hi @serhiyzhovnir! Thank you for the detailed description! I will check this PR again!

@soleksii
Copy link

soleksii commented Apr 2, 2019

✔️ QA Passed

…-email-sending-for-the-sales-entities-which-were-created-with-disabled-email-sending
@m2-assistant
Copy link

m2-assistant bot commented Apr 16, 2019

Hi @serhiyzhovnir, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

magento-engcom-team pushed a commit that referenced this pull request Apr 16, 2019
…tities which were created with disabled email sending #21788
@magento-engcom-team magento-engcom-team added this to the Release: 2.3.2 milestone Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Award: bug fix Component: Sales Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants